#include "workerthread.h"
#include <QDebug>
#include <QMessageBox>
#include <iostream>

#include "app.h"
#include "options-parser.h"


static QStringList stropts;

void setStrOpts(QStringList &plist)
{
    stropts = plist;
}

int run()
{
    std::cout << " Thread run start " << std::endl;

    OptionsParser::GenOptions opts;
    opts.dbc.first = stropts[0].toStdString();//std::string("D:/workspace/dbc_win_qmake/testdb.dbc");
    opts.dbc.second = true;

    opts.outdir.first = stropts[1].toStdString();//std::string("D:/workspace/dbc_win_qmake/gen");
    opts.outdir.second = true;

    opts.drvname.first = stropts[2].toStdString();//std::string("D1") ;
    opts.drvname.second = true;

    opts.is_rewrite = true;

    CoderApp app(opts);
    app.Run();

    qDebug()<<" CoderApp Run end";
    return 0;
}
